/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.goods;

import com.enation.app.javashop.client.goods.GoodsIndexClient;
import com.enation.app.javashop.core.client.fallback.goods.GoodsIndexClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author fk
 * @version v2.0
 * @Description: 商品索引
 * @date 2018/8/14 14:11
 * @since v7.0.0
 */
@FeignClient(name = "goods-service", fallbackFactory = GoodsIndexClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface GoodsIndexClientFeignImpl extends GoodsIndexClient {


    /**
     * 将某个商品加入索引<br>
     *
     * @param goods
     */
    @Override
    @RequestMapping(value = "/client/goods-index", method = RequestMethod.POST)
    void addIndex(@RequestBody Map goods);

    /**
     * 更新某个商品的索引
     *
     * @param goods
     */
    @Override
    @RequestMapping(value = "/client/goods-index/update", method = RequestMethod.POST)
    void updateIndex(@RequestBody Map goods);


    /**
     * 更新
     *
     * @param goods
     */
    @Override
    @RequestMapping(value = "/client/goods-index/delete", method = RequestMethod.POST)
    void deleteIndex(@RequestBody Map goods);

    /**
     * 初始化索引
     *
     * @param list
     * @param index
     */
    @Override
    @RequestMapping(value = "/client/goods-index/all", method = RequestMethod.POST)
    boolean addAll(@RequestBody List<Map<String, Object>> list, @RequestParam("index") int index);

}
